package com.pro.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.Objects;

/**
 * ClassName:JsUserCoupon
 * Package:com.pro.pojo
 * Description: 优惠券实体类
 *
 * @Date:2022/1/10 下午 3:29
 * @Author: WYH
 */
public class JsUserCoupon {

    private Integer couponId;//优惠券主键
    private Integer couponCode;//优惠券编号
    private String couponName;//优惠券名称
    private Integer couponPrice;//优惠券金额
    private String pricuteUrl;//图片路径
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startDate;//开始时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date endDate;//结束时间
    private Integer online;//是否上线，2.上线，3.不上线
    private Integer grant;//发放方式 2.自动发放，3.活动领取 4.人工发放 5.无限制
    private Integer issueQuantity;//发行数量
    private Integer used;//已使用数量
    private Integer type;//类型 2商品3视频
    private String createId;//创建人
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createDate;//创建时间
    private String updateId;//更新人
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateDate;//更新时间

    private String trueName; //用户名称
    private Integer userId; //用户id
    private String account;//用户账号
    private String nickname;//用户名字
    private Integer noUsed;//以使用
    private Integer countEnd;//未使用

    public JsUserCoupon() {
    }

    public JsUserCoupon(Integer couponId, Integer couponCode, String couponName, Integer couponPrice, String pricuteUrl, Date startDate, Date endDate, Integer online, Integer grant, Integer issueQuantity, Integer used, Integer type, String createId, Date createDate, String updateId, Date updateDate, String trueName, Integer userId, String account, String nickname, Integer noUsed, Integer countEnd) {
        this.couponId = couponId;
        this.couponCode = couponCode;
        this.couponName = couponName;
        this.couponPrice = couponPrice;
        this.pricuteUrl = pricuteUrl;
        this.startDate = startDate;
        this.endDate = endDate;
        this.online = online;
        this.grant = grant;
        this.issueQuantity = issueQuantity;
        this.used = used;
        this.type = type;
        this.createId = createId;
        this.createDate = createDate;
        this.updateId = updateId;
        this.updateDate = updateDate;
        this.trueName = trueName;
        this.userId = userId;
        this.account = account;
        this.nickname = nickname;
        this.noUsed = noUsed;
        this.countEnd = countEnd;
    }

    public void setCouponId(Integer couponId) {
        this.couponId = couponId;
    }

    public void setCouponCode(Integer couponCode) {
        this.couponCode = couponCode;
    }

    public void setCouponName(String couponName) {
        this.couponName = couponName;
    }

    public void setCouponPrice(Integer couponPrice) {
        this.couponPrice = couponPrice;
    }

    public void setPricuteUrl(String pricuteUrl) {
        this.pricuteUrl = pricuteUrl;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public void setOnline(Integer online) {
        this.online = online;
    }

    public void setGrant(Integer grant) {
        this.grant = grant;
    }

    public void setIssueQuantity(Integer issueQuantity) {
        this.issueQuantity = issueQuantity;
    }

    public void setUsed(Integer used) {
        this.used = used;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public void setCreateId(String createId) {
        this.createId = createId;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public void setUpdateId(String updateId) {
        this.updateId = updateId;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public void setTrueName(String trueName) {
        this.trueName = trueName;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public void setNoUsed(Integer noUsed) {
        this.noUsed = noUsed;
    }

    public void setCountEnd(Integer countEnd) {
        this.countEnd = countEnd;
    }

    public Integer getCouponId() {
        return couponId;
    }

    public Integer getCouponCode() {
        return couponCode;
    }

    public String getCouponName() {
        return couponName;
    }

    public Integer getCouponPrice() {
        return couponPrice;
    }

    public String getPricuteUrl() {
        return pricuteUrl;
    }

    public Date getStartDate() {
        return startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public Integer getOnline() {
        return online;
    }

    public Integer getGrant() {
        return grant;
    }

    public Integer getIssueQuantity() {
        return issueQuantity;
    }

    public Integer getUsed() {
        return used;
    }

    public Integer getType() {
        return type;
    }

    public String getCreateId() {
        return createId;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public String getUpdateId() {
        return updateId;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public String getTrueName() {
        return trueName;
    }

    public Integer getUserId() {
        return userId;
    }

    public String getAccount() {
        return account;
    }

    public String getNickname() {
        return nickname;
    }

    public Integer getNoUsed() {
        return noUsed;
    }

    public Integer getCountEnd() {
        return countEnd;
    }

    @Override
    public String toString() {
        return "JsUserCoupon{" +
                "couponId=" + couponId +
                ", couponCode=" + couponCode +
                ", couponName='" + couponName + '\'' +
                ", couponPrice=" + couponPrice +
                ", pricuteUrl='" + pricuteUrl + '\'' +
                ", startDate=" + startDate +
                ", endDate=" + endDate +
                ", online=" + online +
                ", grant=" + grant +
                ", issueQuantity=" + issueQuantity +
                ", used=" + used +
                ", type=" + type +
                ", createId='" + createId + '\'' +
                ", createDate=" + createDate +
                ", updateId='" + updateId + '\'' +
                ", updateDate=" + updateDate +
                ", trueName='" + trueName + '\'' +
                ", userId=" + userId +
                ", account='" + account + '\'' +
                ", nickname='" + nickname + '\'' +
                ", noUsed=" + noUsed +
                ", countEnd=" + countEnd +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        JsUserCoupon that = (JsUserCoupon) o;
        return Objects.equals(couponId, that.couponId) &&
                Objects.equals(couponCode, that.couponCode) &&
                Objects.equals(couponName, that.couponName) &&
                Objects.equals(couponPrice, that.couponPrice) &&
                Objects.equals(pricuteUrl, that.pricuteUrl) &&
                Objects.equals(startDate, that.startDate) &&
                Objects.equals(endDate, that.endDate) &&
                Objects.equals(online, that.online) &&
                Objects.equals(grant, that.grant) &&
                Objects.equals(issueQuantity, that.issueQuantity) &&
                Objects.equals(used, that.used) &&
                Objects.equals(type, that.type) &&
                Objects.equals(createId, that.createId) &&
                Objects.equals(createDate, that.createDate) &&
                Objects.equals(updateId, that.updateId) &&
                Objects.equals(updateDate, that.updateDate) &&
                Objects.equals(trueName, that.trueName) &&
                Objects.equals(userId, that.userId) &&
                Objects.equals(account, that.account) &&
                Objects.equals(nickname, that.nickname) &&
                Objects.equals(noUsed, that.noUsed) &&
                Objects.equals(countEnd, that.countEnd);
    }

    @Override
    public int hashCode() {
        return Objects.hash(couponId, couponCode, couponName, couponPrice, pricuteUrl, startDate, endDate, online, grant, issueQuantity, used, type, createId, createDate, updateId, updateDate, trueName, userId, account, nickname, noUsed, countEnd);
    }
}
